package com.atguigu.client;

import com.alibaba.fastjson.JSONObject;
import com.atguigu.entity.*;
import com.atguigu.result.RetVal;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @Description
 * @Author: TT
 * @Date: 2022/7/25 20:41
 */
@FeignClient(value = "shop-product")
public interface ProductFeignClient {
    //根据skuId查询 sku的基本信息
    @GetMapping("sku/getSkuInfo/{skuId}")
    public SkuInfo getSkuInfo(@PathVariable Long skuId);

    //根据分类category3Id查询 商品的分类信息
    @GetMapping("sku/getCategoryView/{category3Id}")
    //根据skuId查询 商品的实时价格
    public BaseCategoryView getCategoryView(@PathVariable("category3Id") Long category3Id);

    @GetMapping("sku/getSkuPrice/{skuId}")
    public BigDecimal getSkuPrice(@PathVariable("skuId") Long skuId);

    //销售属性组合id 和skuId的对应关系
    @GetMapping("sku/getSalePropertyAndSkuIdMapping/{productId}")
    public Map<Object, Object> getSalePropertyIdAndSkuIdMapping(@PathVariable("productId") Long productId);

    //获取所有销售属性 spu和一份sku 对应的销售属性
    @GetMapping("sku/getSpuSalePropertyAndSelected/{productId}/{skuId}")
    public List<ProductSalePropertyKey> getSpuSalePropertyAndSelected(@PathVariable("productId") Long productId,
                                                                      @PathVariable("skuId") Long skuId);
   //查询index 的分类集
    @GetMapping("product/getIndexCategory")
    public RetVal getIndexCategory();

    //8.根据id查询品牌信息
    @GetMapping("product/brand/getBrandById/{brandId}")
    public BaseBrand getBrandById(@PathVariable Long brandId);

    //d.根据商品的skuId查询商品的平台属性
    @GetMapping("product/selectProductKeyFromSkuId/{skuId}")
    public List<PlatformPropertyKey> selectProductKeyFromSkuId(@PathVariable Long skuId);

}